// 用户权限页面
<template>
  <div class="com-page">
    <el-card class="box-card">
      <!-- 作用域插槽 -->
      <template>
        <el-table :data="rightList" style="width: 100%" border>
          <el-table-column type="index" width="80" label="#"> </el-table-column>
          <el-table-column prop="authName" label="权限名称" width="520">
          </el-table-column>
          <el-table-column prop="path" label="路径" width="520">
          </el-table-column>
          <el-table-column prop="level" label="权限等级">
            <template slot-scope="scope">
              <el-tag type="success" v-if="scope.row.level == 1">二级</el-tag>
              <el-tag v-else-if="scope.row.level == 0">一级</el-tag>
              <el-tag type="warning" v-else-if="scope.row.level == 2"
                >三级</el-tag
              >
            </template>
          </el-table-column>
        </el-table>
      </template>
    </el-card>
  </div>
</template>

<script>
import { request } from "@/utils/axios.js";
export default {
  components: {},
  props: {},
  data() {
    return {
      rightList: [],
    };
  },
  watch: {},
  computed: {},
  methods: {
    async getData() {
      const { data: ret } = await request.get("rights/list");
      console.log(ret);
      this.rightList = ret.data;
    },
  },
  created() {
    this.getData();
  },
  mounted() {},
};
</script>
<style lang="less" scoped>
</style>